package com.example.demo.vo.board

import com.example.demo.dao.TNurseLevelDao
import com.example.demo.dao.TPatientDao
import com.example.demo.dbmodels.TNurseLevel
import com.example.demo.dbmodels.TShiftPlan
import com.example.demo.vo.PatientVo
import me.liuwj.ktorm.dsl.QueryRowSet
import java.time.LocalDateTime

class NurseLevelVo {

    /**
     *  自增主键
     **/
    var id: Int? = null

    /**
     *  护理类型
     **/
    var level_type: Int? = null

    /**
     *  护理编码
     **/
    var level_code: String? = null

    /**
     *  护理名称
     **/
    var level_name: String? = null

    /**
     *  护理背景颜色
     **/
    var bg_color: String? = null

    /**
     *  护理字体颜色
     **/
    var font_color: String? = null

    /**
     *  状态1=有效，0=无效
     **/
    var status: Int? = null

    /**
     *  备注
     **/
    var remark: String? = null

    /**
     *  更新时间
     **/
    var update_time: String? = null

    /**
     *  更新人
     **/
    var update_by: String? = null

    /**
     *  删除标记
     **/
    var is_del: Boolean? = null


    fun getNurseLevelVo(table: List<TNurseLevel>?): List<NurseLevelVo>? {
        table?.let {
            val nurseLevelVoList = mutableListOf<NurseLevelVo>()
            table.forEach {
                val data = NurseLevelVo()
                data.id = it.id
                data.bg_color= it.bg_color
                data.font_color = it.font_color
                data.is_del = it.is_del
                data.level_code = it.level_code
                data.level_name= it.level_name
                data.level_type= it.level_type
                data.remark= it.remark
                data.status= it.status
                data.update_by= it.update_by
                data.update_time = it.update_time
                nurseLevelVoList.add(data)
            }
            return  nurseLevelVoList
        }
        return null
    }


    fun getVoQuery(queue: QueryRowSet): NurseLevelVo {
        queue.let {
            val data = NurseLevelVo()
            data.id = it[TNurseLevelDao.id]
            data.level_type = it[TNurseLevelDao.level_type]
            data.level_code = it[TNurseLevelDao.level_code]
            data.level_name = it[TNurseLevelDao.level_name]
            data.bg_color = it[TNurseLevelDao.bg_color]
            data.font_color = it[TNurseLevelDao.font_color]
            data.status = it[TNurseLevelDao.status]
            data.remark = it[TNurseLevelDao.remark]
            data.update_time = it[TNurseLevelDao.update_time]
            data.update_by = it[TNurseLevelDao.update_by]
            data.is_del = it[TNurseLevelDao.is_del]

            return data
        }
    }

}